package com.guyaning.deyson_core.core.delegates.web.client;

import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.blankj.utilcode.util.LogUtils;
import com.guyaning.deyson_core.core.delegates.web.WebDelegate;
import com.guyaning.deyson_core.core.delegates.web.route.Router;

/**
 * Created by Administrator on 2018/7/4.
 */

public class WebViewClientImpl extends WebViewClient {

    public WebDelegate webDelegate;

    public WebViewClientImpl(WebDelegate webDelegate) {
        this.webDelegate = webDelegate;
    }

    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        LogUtils.dTag("shouldOverrideUrlLoading", url);
        return Router.getInstance().handleWebUrl(webDelegate, url);
    }

}
